const data = [1, 3, 4, 5];
function* createIterator() {
  data.forEach((item) => {
    console.log(item);
    yield item
  });
}

const iterator = createIterator();
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
